package com.xzj.mybatis.mapper;

import com.xzj.mybatis.annotation.Param;
import com.xzj.mybatis.annotation.Select;
import com.xzj.mybatis.core.BaseMapper;
import com.xzj.mybatis.entity.po.Blog;

import java.util.List;

/**
 * @ProjectName: SpringDemo
 * @Package: com.xzj.mybatis.mapper
 * @ClassName: BlogMapper
 * @Author: xzj
 * @Description:
 * @Date: 2022/7/22 9:51
 * @Version: 1.0
 */
public interface BlogMapper extends BaseMapper<Blog> {

    /**
     * @Author xzj
     * @Description 根据id查找blog
     * @Date 11:43 2022/7/22
     * @param id
     * @return
     **/
    @Select("SELECT * FROM blog WHERE id = #{id}")
    Blog selectBlog(@Param("id") Integer id);

    @Select("SELECT * FROM blog WHERE user_name like CONCAT('%',#{user_name},'%') ")
    List<Blog> selectAll(Blog blog);

}
